package com.googlecode.todo_robot.frontend.client.model;

import com.google.gwt.user.client.rpc.IsSerializable;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.List;

public class Todo implements IsSerializable {
  public Todo() {
  }

  public Todo(String key, String text, Date dueDate, Priority priority) {
    this.key = key;
    this.text = text;
    this.dueDate = dueDate;
    this.priority = priority;
  }

  public String getKey() {
    return key;
  }

  public void setKey(String key) {
    this.key = key;
  }

  public String getText() {
    return text;
  }

  public void setText(String text) {
    this.text = text;
  }

  public Date getDueDate() {
    return new Date(dueDate.getTime());
  }

  public void setDueDate(Date dueDate) {
    this.dueDate = new Date(dueDate.getTime());
  }

  public List<Date> getReminders() {
    return Collections.unmodifiableList(reminders);
  }

  public void setReminders(List<Date> reminders) {
    this.reminders = new ArrayList<Date>(reminders);
  }

  public String getNotes() {
    return notes;
  }

  public void setNotes(String notes) {
    this.notes = notes;
  }

  public Priority getPriority() {
    return priority;
  }

  public void setPriority(Priority priority) {
    this.priority = priority;
  }

  public String getOwner() {
    return owner;
  }

  public void setOwner(String owner) {
    this.owner = owner;
  }

  public String getWaveId() {
    return waveId;
  }

  public void setWaveId(String waveId) {
    this.waveId = waveId;
  }

  public String getWaveletId() {
    return waveletId;
  }

  public void setWaveletId(String waveletId) {
    this.waveletId = waveletId;
  }

  public String getBlipId() {
    return blipId;
  }

  public void setBlipId(String blipId) {
    this.blipId = blipId;
  }

  public boolean isDone() {
    return done;
  }

  public void setDone(boolean done) {
    this.done = done;
  }

  private String key;
  private String text;
  private Date dueDate;
  private List<Date> reminders;
  private String notes;
  private Priority priority;
  private String owner;
  private String waveId;
  private String waveletId;
  private String blipId;
  private boolean done;


  public enum Priority {
    HIGH, MEDIUM, LOW, NONE
  }
}
